package com.gta.edu.sdk.common.dto;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;

public class LogTranferDto {
	private static final Logger log = Logger.getLogger(LogTranferDto.class);
	private static LogTranferDto dto = new LogTranferDto();

	private Properties properties = new Properties();

	private LogTranferDto() {
		try {
			InputStream iStream = LogTranferDto.class.getClassLoader().getResourceAsStream("log_transfer_config.properties");
			properties.load(iStream);
		} catch (IOException e) {
			log.error("获取日志传输配置文件失败，请检查文件是否存在！", e);
		}
	}

	public static LogTranferDto getInstance() {
		return dto;
	}

	public String getRemoteIp() {
		return properties.getProperty("log.transfer.config.remote.ip");
	}

	public int getRemotePort() {
		return Integer.parseInt(properties.getProperty("log.transfer.config.remote.port"));
	}

	public String getRemoteUserName() {
		return properties.getProperty("log.transfer.config.remote.username");
	}

	public String getRemotePassword() {
		return properties.getProperty("log.transfer.config.remote.password");
	}

	public String getRemoteLogRootPath() {
		return properties.getProperty("log.transfer.config.remote.logrootpath");
	}

}
